package main

func getRow(rowIndex int) []int {
	preRow := []int{1}
	for i := 1; i <= rowIndex; i++ {
		curRow := []int{}
		for j := 0; j <= i; j++ {
			var a int
			if j > 0 {
				a = preRow[j-1]
			} else {
				a = 0
			}

			var b int
			if j < len(preRow) {
				b = preRow[j]
			} else {
				b = 0
			}
			curRow = append(curRow, a+b)
		}
		preRow = curRow
	}
	return preRow

}
